// 导入二次封装axios
import koi from "@/utils/axios.ts";


// 统一管理接口
enum API {
  LIST_PAGE = "/admin/member/member/list",
  GET_BY_ID = "/admin/member/member/getById",
  UPDATE = "/admin/member/member/update",
  ADD = "/admin/member/member/add",
  UPDATE_STATE = "/admin/member/member/updateStatus",
  RESET_PWD = "/admin/member/member/resetPwd",
  INTEGRAL_RECORD = "/admin/member/member/integralRecord",
  ORDER_RECORD = "/admin/member/member/orderRecord",
  BALANCE_RECORD = "/admin/member/member/balanceRecord",
}
export const listPage = (params: any) => {
  return koi.get(API.LIST_PAGE, params);
};

// 根据ID进行查询
export const getById = (id: any) => {
  return koi.get(API.GET_BY_ID, { id });
};

// 根据ID进行修改
export const update = (data: any) => {
  return koi.post(API.UPDATE, data);
};

// 添加
export const add = (data: any) => {
  return koi.post(API.ADD, data);
};

// 修改状态
export const updateStatus = (id: any, status: any) => {
  return koi.post(API.UPDATE_STATE, { id, status });
};
// 重置密码
export const resetPwd = (id: any) => {
  return koi.post(API.RESET_PWD, { id });
};
export const integralRecord = (params: any) => {
  return koi.get(API.INTEGRAL_RECORD, params);
};
export const orderRecord = (params: any) => {
  return koi.get(API.ORDER_RECORD, params);
};
export const balanceRecord = (params: any) => {
  return koi.get(API.BALANCE_RECORD, params);
};
